package model;

import main.Terminal;

/**
 * 
 * @author Patrick
 *
 */

public class Movie 
{
	private int id;
	private double price;
	private int lenght;
	private String title;
	private int commercialTime;
	private String description;
	private boolean is3D;
	
	public Movie(int id, double price, int lenght, String title, int commercialTime, String description, boolean is3D) 
	{
		this.id = id;
		this.price = price;
		this.lenght = lenght;
		this.title = title;
		this.commercialTime = commercialTime;
		this.description = description;
		this.set3D(is3D);
	}

	public int getId() 
	{
		return id;
	}

	public void setId(int id) 
	{
		this.id = id;
	}

	public double getPrice() 
	{
		return price;
	}

	public void setPrice(double price) 
	{
		this.price = price;
	}

	public int getLenght() 
	{
		return lenght;
	}

	public void setLenght(int lenght) 
	{
		this.lenght = lenght;
	}

	public String getTitle() 
	{
		return title;
	}

	public void setTitel(String title) 
	{
		this.title = title;
	}

	public int getCommercialTime() 
	{
		return commercialTime;
	}

	public void setCommercialTime(int commercialTime) 
	{
		this.commercialTime = commercialTime;
	}

	public String getDescription() 
	{
		return description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	public boolean is3D() 
	{
		return is3D;
	}

	public void set3D(boolean is3D) 
	{
		this.is3D = is3D;
	}
	
	@Override
	public boolean equals(Object obj) 
	{
		try {
			Movie otherMovie = (Movie) obj;
			return otherMovie.getId() == getId();
		}
		catch(Exception e) {
			Terminal.say(obj + " is not a Movie-object!", e);
		}
		
		return false;
	}
	
}
